import 'package:flutter/material.dart';
import 'package:sui_shou_pai/module/color.dart';
import 'package:sui_shou_pai/news/data/comment_list_item_data.dart';

Widget initCommentListItem(CommentListItemData item) {
  return Container(
    margin: EdgeInsets.only(top: 4, bottom: 4),
    padding: EdgeInsets.all(12),
    decoration: BoxDecoration(
      color: greyF6F6F6,
      borderRadius: BorderRadius.circular(8),
    ),
    child: Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Row(
          children: [
            ClipRRect(
              borderRadius: BorderRadius.circular(12),
              child: Image.network(item.avatar, height: 24),
            ),
            Container(
              margin: EdgeInsets.only(left: 8),
              child: Text(
                '${item.name}  ${item.time}',
                style: TextStyle(color: Colors.grey, fontSize: 14),
              ),
            )
          ],
        ),
        Container(
          margin: EdgeInsets.only(left: 32, top: 2),
          child: Text(
            item.content,
            style: TextStyle(fontSize: 16),
          ),
        )
      ],
    ),
  );
}
